@@ -61,7 +61,7 @@ module Agents |
||
| 61 | 61 |
|
| 62 | 62 |
def validate_options |
| 63 | 63 |
errors.add(:base, "zipcode is required") unless options[:zipcode].present? |
| 64 |
- errors.add(:base, "api_key is required") unless key_setup? |
|
| 64 |
+ errors.add(:base, "api_key is required") unless options[:api_key].present? |
|
| 65 | 65 |
end |
| 66 | 66 |
|
| 67 | 67 |
def check |
@@ -13,7 +13,7 @@ unless user.agents.where(:name => "SF Weather Agent").exists? |
||
| 13 | 13 |
Agent.build_for_type("Agents::WeatherAgent", user,
|
| 14 | 14 |
:name => "SF Weather Agent", |
| 15 | 15 |
:schedule => "10pm", |
| 16 |
- :options => {:zipcode => "94103"}).save!
|
|
| 16 |
+ :options => { :zipcode => "94103", :api_key => "your-key" }).save!
|
|
| 17 | 17 |
end |
| 18 | 18 |
|
| 19 | 19 |
unless user.agents.where(:name => "XKCD Source").exists? |